package it.com;

import java.util.Scanner;

public class SwitchDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = scanner.nextInt();
        switch (num){
            case 1:
                System.out.println("今天周一");
                break;
            case 2:
                System.out.println("今天周二");
                break;
            default:
                System.out.println("今天休息");
                break;
        }


        //switch的穿透性
        int month = scanner.nextInt();
        switch (month){
            case 1:
            case 2:
            case 3:
                System.out.println("在春季");
                break;
            case 4:
            case 5:
            case 6:
                System.out.println("在夏季");
                break;
            case 7:
            case 8:
            case 9:
                System.out.println("在秋季");
                break;
            case 10:
            case 11:
            case 12:
                System.out.println("在冬季");
                break;
            default:
                System.out.println("没有这个月份");
                break;
        }
    }
}
